home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Winter Shell 1.0d2 / Source / Libraries / ByteLib / ByteLib.c next >
Encoding:
C/C++ Source or Header  |  1993-06-21  |  369 b   |  19 lines  |  [TEXT/KAHL]

  1. /* Byte manipulation functions.
  2.  
  3.     92/02/20 Ari Halberstadt (AIH)
  4.     - Created to avoid using ugly bit operations throughout my code.
  5. */
  6.  
  7. #include <limits.h>
  8. #include "ByteLib.h"
  9.  
  10. unsigned char LoByte(unsigned short x)
  11. {
  12.     return(x & (unsigned char) 0x00ff);
  13. }
  14.  
  15. unsigned char HiByte(unsigned short x)
  16. {
  17.     return((x >> (unsigned short) CHAR_BIT) & (unsigned char) 0x00ff);
  18. }
  19.